<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:49:"themes/admin_simpleboot3/mainiu/code/codeadd.html";i:1514343185;s:43:"themes/admin_simpleboot3/public/header.html";i:1514341885;}*/ ?>
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <!-- Set render engine for 360 browser -->
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- HTML5 shim for IE8 support of HTML5 elements -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <![endif]-->

    <link href="__TMPL__/public/assets/themes/<?php echo cmf_get_admin_style(); ?>/bootstrap.min.css" rel="stylesheet">
    <link href="__TMPL__/public/assets/simpleboot3/css/simplebootadmin.css" rel="stylesheet">
    <link href="__STATIC__/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <style>
        form .input-order {
            margin-bottom: 0px;
            padding: 0 2px;
            width: 42px;
            font-size: 12px;
        }

        form .input-order:focus {
            outline: none;
        }

        .table-actions {
            margin-top: 5px;
            margin-bottom: 5px;
            padding: 0px;
        }

        .table-list {
            margin-bottom: 0px;
        }

        .form-required {
            color: red;
        }
    </style>
    <script type="text/javascript">
        //全局变量
        var GV = {
            ROOT: "__ROOT__/",
            WEB_ROOT: "__WEB_ROOT__/",
            JS_ROOT: "static/js/",
            APP: '<?php echo \think\Request::instance()->module(); ?>'/*当前应用名*/
        };
    </script>
    <script src="https://cdn.bootcss.com/jquery/1.11.0/jquery.min.js"></script>
    <script src="__STATIC__/js/wind.js"></script>
    <script src="__TMPL__/public/assets/js/bootstrap.min.js"></script>
    <script>
        Wind.css('artDialog');
        Wind.css('layer');
        $(function () {
            $("[data-toggle='tooltip']").tooltip();
            $("li.dropdown").hover(function () {
                $(this).addClass("open");
            }, function () {
                $(this).removeClass("open");
            });
        });
    </script>
    <?php if(APP_DEBUG): ?>
        <style>
            #think_page_trace_open {
                z-index: 9999;
            }
        </style>
    <?php endif; ?>
<style type="text/css">
    .pic-list li {
        margin-bottom: 5px;
    }
</style>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="<?php echo url('code/codeadd'); ?>">二维码添加</a></li>
    </ul>
        <div class="row">
            <div class="col-md-9">
                <table class="table table-bordered">
                    <tr>
                        <th><b>请输入二维码名称 </b><b style="color: red;">* 目前不支持中文，若中文无法生成！</b></th>
                    </tr>
                    <tr>
                        <td>
                            <input class="form-control namme" type="text" name=""
                                   id="title" required value="" placeholder="请输入名称"/>
                        </td>
                    </tr>
                    <tr>
                        <th><b>请输入二维码描述 </b></th>
                    </tr>
                    <tr>
                        <td>
                            <input class="form-control dess" type="text" name=""
                                    required value="" placeholder="请输入描述"/>
                        </td>
                    </tr>
                    <tr>
                        <th><b>二维码图 </b><b style="color: green">* 鼠标点击右键保存</b></th>
                    </tr>
                    <tr>
                        <td>
                            <div style="text-align: center;">
                                <img class="qrcode2" src="__TMPL__/public/assets/images/default-thumbnail.png"
                                     id="thumbnail-preview"
                                     width="135" style="cursor: pointer"/>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <th><b>添加时间</b></th>
                    </tr>
                    <tr>
                        <td>
                            <input class="form-control js-bootstrap-datetime" type="text" name="post[published_time]"
                                   value="<?php echo date('Y-m-d H:i:s',time()); ?>">
                        </td>
                    </tr>
                </table>
                <div class="form-group">
                    <div class="col-sm-offset-5 col-sm-10">
                        <audio class="mpp3" controls="controls">
                            <source src="__TMPL__/public/6480.mp3"/>
                        </audio>
                        <button type="button" style="width: 10vw;" class="btn btn-success subb">确定提交</button>
                    </div>
                </div>
            </div>
        </div>
</div>
    <script>
        $('.mpp3').hide();
        $('.subb').click(function () {
            var textname = $('.namme').val();
            var textdes = $('.dess').val();
            $('.subb').text('提交中......');
            console.log(textname);
            $.ajax({
                url:'/mainiu/code/add',
                type:"post",
                data:{
                    name:textname,
                    des:textdes
                },
                success:function(data){
                    var ress= $.parseJSON(data);
                    if(ress.sta==1){
                        $('.mpp3')[0].play();
                    }
                    $('.subb').text('确定提交');
                    $('.qrcode2').attr("src",ress.codethumb);
                },
                error:function(e){
                    alert('失败');
                }
            });
        });
    </script>
</body>
</html>
